<?php include 'inc/header.php';?>
<?php
        $sql = 'SELECT * FROM review';
        $result = mysqli_query($conn, $sql);
        $reviews = mysqli_fetch_all($result, MYSQLI_ASSOC);
?>

<h2>课程评价</h2>

<?php if(empty($reviews)): ?>
 <p class="lead mt3">⽬前没有课程评价！</p>
<?php endif; ?>

<?php foreach($reviews as $review):?>
 <div class="card my-3" style="width: 18rem;">
        <div class="card-title text-center mt-2">
                <?php echo $review['content_name']; ?>
        </div>
        <div class="card-body text-center">
        "
                <?php echo $review['content']; ?>
        "
        <div class="card-secondary mt-2">
                <?php echo $review['name']; ?>
        </div>
        <div class="text-secondary mt-2">
                <?php echo $review['date'];?>
        </div>
        </div>
 </div>
<?php endforeach; ?>

        <!-- <div class="card my-3" style="width: 18rem;">
        <div class="card-body">
        这是⼀门⾮常实⽤的课程，深⼊浅出地介绍了编程基础。⽼师讲解清晰，配
        </div>
        </div> -->
        <!-- <div class="card my-3" style="width: 18rem;">
        <div class="card-body">
        我通过这门课程掌握了数据分析的核⼼技术，课程内容覆盖⼴泛，案例实战
        </div>
        </div>
        <div class="card my-3" style="width: 18rem;">
        <div class="card-body">
        作为⼀个设计背景的学⽣，这门课程帮我打开了前端开发的⼤门。课程结构
        </div>
        </div> -->
        
 <?php include 'inc/footer.php';?>
 <!-- 完成 -->